
<div id="add-blocked-to-list" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-header">
	<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
	<h3 id="myModalLabel">Add to blocked list</h3>
    </div>
    <?php
    $form = $this->beginWidget('CActiveForm', array(
	'id' => 'blocked-form',
	'enableAjaxValidation' => FALSE,
	'enableClientValidation' => true,
	'action' => SITE_NAME_URL . 'mailbox/message/add_to_blocked_list',
	'clientOptions' => array(
	    'validateOnSubmit' => true
	),
	'htmlOptions' => array(
	    'class' => 'form-horizontal'
	)
    ));
    ?>
    <div class="modal-body">
	<p>
	    <input type="text" id="email-txt" />
	    <?php
	    echo $form->error($model, 'blocked_user');
	    echo $form->hiddenField($model, 'blocked_user');
	    ?>	    
	</p>
    </div>
    <div class="modal-footer">
	<?php
	?>
	<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>	
	<input type="submit" class="btn btn-info" value="Save changes" name='add'/>
    </div>
    <?php
    $this->endWidget();
    ?>   

</div>

<script>
    $(document).ready(function() {
	$("#email-txt").autocomplete({
	    source: "<?php echo SITE_NAME_URL ?>user/get_list_email",
	    minLength: 1,
	    select: function(event, ui) {
		$('#BlockMessage_blocked_user').val(ui.item.id);
	    }
	});
    });
</script>